package com.huan.ai.config;

import org.springframework.ai.chat.client.ChatClient;
import org.springframework.ai.openai.OpenAiChatModel;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * ai 配置
 *
 * @author huan.fu
 * @date 2025/6/8 - 08:44
 */
@Configuration
public class AiConfiguration {

    @Bean
    public ChatClient chatClient(OpenAiChatModel openAiChatModel) {
        return ChatClient.builder(openAiChatModel)
                // 默认系统提示词
                .defaultSystem("你是一个生活小助手")
                .build();
    }
}
